﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Windows.Forms;
using System.Drawing;

namespace FileViewer
{
    class AnimaButton
    {
        PictureBox Pic;
        Image Active, Passive;
        TextBox Name;

        public string Text
        {
            get
            {
                return Name.Text;
            }
            set
            {
                Name.Text = value;
            }
        }


        private AnimaButton()
        { }

        public AnimaButton(Control Owner)
        {
            Pic = new PictureBox();
            Pic.Parent = Owner;

            Active = Image.FromFile(@"F:\Users\Nekseron\Desktop\артем\vrn-file-manager\FileViewer\Image\1.jpg"); 
            Passive = Image.FromFile(@"F:\Users\Nekseron\Desktop\артем\vrn-file-manager\FileViewer\Image\2.jpg");

            Pic.Image = Passive;

            Pic.MouseMove += Pic_MouseMove;
            Pic.MouseLeave += Pic_MouseLeave;

            Name = new TextBox();
            Name.Parent = Owner;
            Name.Multiline = true;
            Name.Enabled = false;


        }

        private void Pic_MouseMove(object sender, MouseEventArgs e)
        {
            if (Pic.Image != Active)
                Pic.Image = Active;                    
        }

        private void Pic_MouseLeave(object sender, EventArgs e)
        {
            if (Pic.Image != Passive)
                Pic.Image = Passive;
        }

        

    }
}
